package com.manong.bookstore.user.feign;

import com.manong.common.utils.R;
import com.manong.bookstore.user.entity.AddressEntity;
import com.manong.bookstore.user.entity.UserEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient("bookstore-user")
public interface UserFeignService {
	@RequestMapping("/user/session/create")
	public String create();

	@RequestMapping("/user/session/remove")
	public boolean remove(@RequestParam String sessionId);

	@RequestMapping("/user/session/setAttribute")
	public boolean setAttribute(@RequestParam String sessionId, @RequestParam String key, @RequestParam String value);

	@RequestMapping("/user/session/search")
	public boolean search(@RequestParam String sessionId);

	@RequestMapping("/user/session/info")
	public R info(@RequestParam String sessionId);


	@RequestMapping("/user/user/save")
	public R save(@RequestBody UserEntity user);


	@RequestMapping("/user/user/loginByUserId")
	public R loginByUserId(@RequestParam Map<String, Object> params);

	@RequestMapping("/user/user/info")
	public R info(@RequestParam Map<String, Object> params);

	@RequestMapping("/user/user/update/info")
	public R updateInfo(@RequestParam Map<String, Object> params);


	@RequestMapping("/user/address/save")
	public R save(@RequestBody AddressEntity address);

	@RequestMapping("/user/address/findUserAddress")
	public R findUserAddress(@RequestParam Map<String, Object> params);

	@RequestMapping("/user/address/setDefaultAddress")
	public R setDefaultAddress(@RequestParam Map<String, Object> params);
}
